<?php

namespace app\admin\validate;

use think\Validate;

class Linkage extends Validate
{
    protected $rule = [
        'name' => 'require|token|length:1,20|unique:linkage,name,0,id',
    ];

    protected $message = [
        'name.require' => '用户名必须输入',
        'name.length' => '用户名需在5-18字符',
        'name.unique' => '用户名已存在',
    ];

    protected $scene = [
        'add' => ['name'],
        'edit' => ['name'],
    ];

}
